//
//  CellForLeaderboard.m
//  UESTCPioneer
//
//  Created by sss on 14-8-18.
//  Copyright (c) 2014年 Sway. All rights reserved.
//

#import "CellForLeaderboard.h"

#define viewWidth 320

@implementation CellForLeaderboard

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
        [self.contentView addSubview:self.rank];
        [self.contentView addSubview:self.instOrbranch];
        [self.contentView addSubview:self.actIndex];
        [self.contentView addSubview:self.changeImg];
        [self.contentView addSubview:self.changeLabel];
        [self.contentView addSubview:self.headImg];
        [self.contentView addSubview:self.notelabel];
    }
    return self;
}

- (void)awakeFromNib
{
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}
-(UILabel*)rank{
    if (!_rank) {
        _rank = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, 30,self.frame.size.height)];
        _rank.textColor = [UIColor blackColor];
        _rank.textAlignment = NSTextAlignmentCenter;
        _rank.font = [UIFont systemFontOfSize:12.0];
        _rank.text = @"-";
    }
    return _rank;
}

-(UILabel*)instOrbranch{
    if (!_instOrbranch) {
        _instOrbranch = [[UILabel alloc] initWithFrame:CGRectMake(30, 0, 170,self.frame.size.height)];
        _instOrbranch.textColor = [UIColor grayColor];
        _instOrbranch.textAlignment = NSTextAlignmentCenter;
        _instOrbranch.font = [UIFont systemFontOfSize:12.0];
        _instOrbranch.text = @"-";
        _instOrbranch.numberOfLines = 0;
    }
    return _instOrbranch;
}

-(UILabel*)actIndex{
    if (!_actIndex) {
        _actIndex = [[UILabel alloc] initWithFrame:CGRectMake(200, 0, 60,self.frame.size.height)];
        _actIndex.textColor = [UIColor blackColor];
        _actIndex.textAlignment = NSTextAlignmentCenter;
        _actIndex.font = [UIFont systemFontOfSize:12.0];
        _actIndex.text = @"-";
    }
    return _actIndex;
}
-(UILabel*)changeLabel{
    if (!_changeLabel) {
        _changeLabel = [[UILabel alloc] initWithFrame:CGRectMake(280 , 0, 40,self.frame.size.height)];
        _changeLabel.textColor = [UIColor grayColor];
        _changeLabel.textAlignment = NSTextAlignmentCenter;
        _changeLabel.font = [UIFont systemFontOfSize:10.0];
        _changeLabel.text = @"-";
    }
    return _changeLabel;
}
-(UIImageView*)changeImg{
    if (!_changeImg) {
        _changeImg = [[UIImageView alloc] initWithFrame:CGRectMake(260 , 15, 15, 15)];
//        _changeImg.backgroundColor = [UIColor greenColor];
    }
    return _changeImg;
}

-(UIImageView*)headImg{
    if (!_headImg) {
        _headImg = [[UIImageView alloc] initWithFrame:CGRectMake(5, 10, 25, 25)];
    }
    return _headImg;
}

-(UILabel*)notelabel{
    if (!_notelabel) {
        _notelabel = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width,self.frame.size.height)];
        _notelabel.textColor = [UIColor blackColor];
        _notelabel.textAlignment = NSTextAlignmentCenter;
        _notelabel.font = [UIFont systemFontOfSize:12.0];
        _notelabel.text = @"";
        _notelabel.backgroundColor = [UIColor colorWithRed:235.0f/255.0f green:235.0f/255.0f blue:241.0f/255.0f alpha:1];
    }
    return _notelabel;
}

@end
